/**
oldList, newList 为要合并的元素
key用来判断是否为同一个元素
返回合并的数组
*/
function mergeObjectListByKey(oldList, newList, key) {

}

// 测试数据
const team = [
  {id: 1, name: '张三', age: 11},
  {id: 2, name: 'mike', age: 22},
  {id: 3, name: '小李', age: 44},
  {id: 5, name: '李', age: 44, gender: 1},
]
const newTeam = [
  {id: 2, name: 'mike', age: 99},
  {id: 3, name: '小李', tel: 18899998888},
  {id: 4, name: 'jay'},
  {id: 5, name: '李', age: 44, gender: 0, tel: 12312312312},
]

// 输出验证，预期true
const mergedTeam = mergeObjectListByKey(team, newTeam, 'id').sort((a,b) => a.id - b.id)
const testCase = [
  {id: 1, name: '张三', age: 11},
  {id: 2, name: 'mike'},
  {id: 3, name: '小李', age: 44, tel: 18899998888},
  {id: 4, name: 'jay'},
  {id: 5, name: '李', age: 44, tel: 12312312312},
]
console.log(JSON.stringify(mergedTeam) === JSON.stringify(testCase))
